<%-- 
    Document   : login
    Created on : May 21, 2012, 2:38:15 PM
    Author     : ciummo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="WEB-INF/struts-logic.tld" prefix="logic" %>



<html:html>
    <head>
        <html:base/>
        <title><bean:message key="title.login"/></title>

        <link rel="stylesheet" type="text/css" href="/DGestWebServer/css/dgest.css"/>
    </head>
    <body>
        
        <div class="message">${message}</div>
        <div class="error">${error}</div>
        
        <logic:present name="user" scope="session">
           <p> <bean:message key="message.alreadylogged"/>
                 <html:link action="/Login?method=secureLogout"><bean:message key="button.logout"/></html:link> </p> 
        </logic:present>
        
        
        <logic:notPresent name="user" scope="session">
            <div style="color:red">
                <html:errors />
            </div>
            
            <bean:cookie id="uname" name="DGestUsername" value=""/>
            <bean:cookie id="pword" name="DGestPassword" value=""/>

            
            <h2>Effettuare l'accesso</h2>
            
            <div class ="login">
            
            <table>
                
                <thead></thead>
                
                <tbody>
            <html:form action="/Login?method=secureLogin" >

                <tr>
                    <td><bean:message key="prompt.login.username"/> : </td>
                    <td><html:text name="LoginActionForm" property="username"/> <br></td></tr>
                
                <tr>
                    
                    <td><bean:message key="prompt.login.password"/> : </td>
                    <td><html:password name="LoginActionForm" property="password"/> <br></td></tr>
                
                <tr>
                    <td><bean:message key="prompt.login.cookies"/>
                <html:checkbox property="cookies"></html:checkbox></td>
                    <td>
                <html:submit>
                    <bean:message key="button.login"/>
                </html:submit></td></tr>
            </html:form>
                
                
                </tbody>
            </table>
            </div>
        </logic:notPresent>    
    </body>
</html:html>